<template>
  <div
    id="app"
    v-loading.fullscreen.lock="loadingRef > 0"
    element-loading-text="拼命加载中"
    element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.6)"
  >
    <keep-alive>
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>
import { mapState } from 'vuex';

export default {
  name: 'app',
  computed: mapState(['loadingRef']),
  created() {
    const loginSysUserVo = JSON.parse(localStorage.getItem('loginSysUserVo'));
    if (loginSysUserVo) {
      this.$store.dispatch('updateLoginSysUserVo', loginSysUserVo);
    }
  },
};
</script>

<style lang="scss">
body {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  overflow: auto;
  height: 100vh;
}
#app {
  height: 100vh;
}
</style>
